package com.cosmo.integration.web;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.Header;
import org.apache.http.StatusLine;

public class HttpResponseResult {

	private String responseBody;
	private StatusLine statusLine;
	private List<Header> headers;

	public void setResponseBody(String responseBody) {
		this.responseBody = responseBody;
	}
	public String getResponseBody() {
		return responseBody;
	}
	public StatusLine getStatusLine() {
		return statusLine;
	}
	public void setStatusLine(StatusLine statusLine) {
		this.statusLine = statusLine;
	}
	public List<Header> getHeaders() {
		return headers;
	}
	public void setHeaders(List<Header> headers) {
		this.headers = headers;
	}
	public void addHeader(Header header) {
		if (this.headers == null)
			this.headers = new ArrayList<Header>();
		this.headers.add(header);
	}

	@Override
	public String toString() {
		return (statusLine == null) ? responseBody : statusLine.toString();
	}

}
